/**
 * this class file just use to format reqeust response data
 */

import { Detector } from '.';

export class DetectorInfo implements Detector {
    cycleLength: string;
    cycleLevel: string;
    detLevel: string;
    detPower: string;
    speedLevel: string;
    speedRate: string;
    detTonAmplify: string;
    detTonAmplifyUrl: string;
    readonly realDetPower: number;

    constructor(info: Detector) {
        this.cycleLength = info.cycleLength
        this.cycleLevel = info.cycleLevel
        this.detLevel = info.detLevel
        this.detPower = info.detPower
        this.speedLevel = info.speedLevel
        this.speedRate = info.speedRate
        this.detTonAmplify = info.detTonAmplify
        this.detTonAmplifyUrl = info.detTonAmplifyUrl;

        this.realDetPower = Number(this.detPower || 0) * Number(this.detTonAmplify || 1)
    }
}